{% include file="index.header.tpl.php" %}
{% include file="index.left.tpl.php" %}
 <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
             <form action=" " method="get">
                <div class="box-header with-border">
                    <span class="fa fa-table" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">因病缺课月报表</p>
                </div>
				<div class="box-body">
                    <div class="col-md-3 form-group">
						  <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; margin:0;">
							   学年学期：
						  </label>
						  <div class="input-group col-md-8 col-xs-12">
							      <select class="form-control" name="semester_id" id="semester_id">
								  <option value="">请选择</option>
								  {%foreach from=$semester_lists key=key item=value%}
									  <option value="{%$value.semester_id%}"{%if $value.semester_id==$semester_id %}selected{%/if%}>{%$value.semester_xname%}{%$value.semester_name%}</option>
								  {%/foreach%}
									</select> 
						     </div> 
				       </div>
					   <div class="col-md-3 form-group">
						  <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; margin:0;">
							   月份：
						  </label>
						  <div class="input-group col-md-8 col-xs-12">
							       <select class="form-control" id="semester_month" name="month_id">
										{%foreach from=$week_lists key=key item=value%}
									  <option value="{%$value.semester_month%}"{%if $value.semester_month==$semester_month %}selected{%/if%}>{%$value.semester_month%}</option>
								  {%/foreach%}
                                   </select>
						     </div> 
				       </div>
					    <input type="hidden" name="a" value="disease.monthdetails">
					    <button type="submit" class="btn btn-warning">查 询</button>
                   <div style="clear:both; height:8px;"></div>
                   <h4 class=" text-center">{%$semester_data.semester_name%}学生因病缺课主要症状第每月汇总表</h4>
                   <p class="text-center"> 
						第{%$semester_month%}月（{%$month_time.start_time%}至{%$month_time.end_time%}）
				   </p>
                   <span>
						地区类别：{%$baseset_data.baseset_registered%}
				   </span>
				   <span style=" margin-left:50px;">
						学校类型：{%$baseset_data.baseset_area%}
				   </span>
                   <p style="margin-top:10px;">
						全校学生应出勤人数：男生{%$man_count.count%} 人，女生{%$woman_count%} 人，合计{%$student_count.count%} 人。  学校因病缺课率：{%$percent%}
				   </p>                   
                      <table class="table table-bordered"  id="mytable">
                                    <tr>
                                        <td rowspan="3">年级</td>
                                        <td rowspan="2" colspan="2">因病缺课人数</td>
                                        <td colspan="14" align="center">因病缺课主要症状人数</td>
                                    </tr>
                                     <tr>
									 {%foreach from=$disease_ini key=key item=value%}
                                        <td colspan="2">{%$value%}</td>
									 {%/foreach%}
                                    </tr>
                                    <tr>
                                        <td>男</td>
                                        <td>女</td>
									{%foreach from=$disease_ini key=key item=value%}
                                        <td>男</td>
                                        <td>女</td>
									{%/foreach%}
                                    </tr>
									{%foreach from=$grade_lists key=key item=value%}
                                    <tr>
                                        <td>{%$value.grade_name%}</td>

                                        <td>{%$value.boy%}</td>
                                        <td>{%$value.girl%}</td>
										{%foreach from=$value.all key=k item=v%}
                                        <td>{%$v%}</td>
										{%/foreach%}
                                    </tr>
									{%/foreach%}
                        </table>
                        <div class="form-group">
                           <p>备注：{%$explain_data.explain_content%}</p>
                        </div>
				   </div><!--box-body -->
 
               </form>
			   <div class="box-footer" style="border-top:0px;">
					{%$page%}
			   </div> 
           </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
{% include file="index.footer.tpl.php" %}
<script type="text/javascript">
        $(document).ready(function () {
            $("#semester_id").change(function () {		
                if ($(this).val() == "-1") {
					$("#industr").remove(); return; 
					}
                else {
			var timestamp = new Date().getTime();
			$.ajax({
			url:"index.php?a=semester.MonthJson",
			type:"get",
			data: "semester_id=" + $("#semester_id").find("option:selected").val() + "&timestamp=" + timestamp,
			dataType:"json",
			success:function(msg){
			   
					//实例2个字符串变量来拼接下拉列表
					var industr = "";
					//使用jquery解析json中的数据
					$.each(msg, function (n, value) {
						industr += ("<option value=\"" + value.semester_month + "\">" + value.semester_month);
						industr += ("</option>");
					});

					$("#semester_month").html(industr);			   			   
			}
			});					

                }

            });

        });
</script>
